import request from '@/utils/request'

// 查询所有文章栏目
export function getArticleColumn() {
	return request({
		url: '/articleColumn/getAll',
		method: 'get',
	})
}

// 添加文章
export function addArticle(data) {
	return request({
		url: '/article/add',
		method: 'post',
		data: data
	})
}

// 删除文章
export function delArticle(data) {
	return request({
		url: '/article/del',
		method: 'post',
		data: data
	})
}

// 通过主键查询文章内容
export function getArticleByKey(params) {
	return request({
		url: '/article/getByKey/noAuth',
		method: 'get',
		params: params
	})
}

// 分页查询
export function getArticlePage(params) {
	return request({
		url: '/article/getPage/noAuth',
		method: 'get',
		params: params
	})
}

// 上传图片
export function uploadRichImgApi(data) {
	return request({
		url: '/article/addRichFile',
		method: 'post',
		data: data,
		headers: {
			"Content-Type": "multipart/form-data"
		}
	})
}


// 修改
export function updArticle(data) {
	return request({
		url: '/article/upd',
		method: 'post',
		data: data
	})
}
